import { request } from './request';

export function queryHouseList() {
  return request({
    url: '/houses/getAll',
    method: "GET"
  })
}

export function addHouse(form) {
  return request({
    url: '/houses/add',
    method: "POST",
    header: {
      'Content-Type': 'multipart/form-data'
    },
    data: form,
  })
}

export function getHouseByUid(uid){
  return request({
    url:'/houses/getbyuid',
    method:"GET",
    params:{uid}
  })
}

export function getHouseByHid(hid){
  return request({
    url:'/houses/getbyhid',
    method:"GET",
    params:{hid}
  })
}

export function collectionByUid(uid){
  return request({
    url:'/collections/selectByUid',
    method:"GET",
    params:{uid}
  })
}

export function reportByUid(uid){
  return request({
    url:'/reports/getbyuid',
    method:'GET',
    params:{uid}
  })
}
// 参与的合租
export function shareByUid(uid){
  return request({
    url:'/shareinformations/getbyuid',
    method:"GET",
    params:{uid}
  })
}

// 删除收藏
export function deleteFavorite(uid, hid){
  return request({
    url:'/collections/delete',
    method:"GET",
    params:{uid, hid}
  })
}
export function getgoodHouse(){
  return request({
    url:'/houses/goodHouse',
    method:"GET"
  })
}
export function getnotgoodHouse(){
  return request({
    url:'/houses/notgoodHouse',
    method:"GET"
  })
}

export function addShare(form){
  return request({
    url:'/shareinformations/add',
    method:'POST',
    data: form
  })
}

export function getCommentByHid(id){
  return request({
    url:'/comments/getbyhid',
    method:"GET",
    params:{id}
  })
}
export function getCommentByUid(id){
  return request({
    url:'/comments/getbyuid',
    method:"GET",
    params:{id}
  })
}
export function addComment(form){
  return request({
    url:'/comments/add',
    method:"POST",
    data:form
  })
}

export function getHouseBylotskeys(form){
  return request({
    url:'/houses/getbylotskeys',
    method:"POST",
    data:form
  })
}
